<head>
<meta charset="utf-8">
</head>
<img id="pic" src="pic_bulboff.gif">
<button id="btn" onclick="light()">开灯</button>
<script>

function light(){

if(btn.innerHTML=="开灯"){
pic.src="pic_bulbon.gif";
btn.innerHTML="关灯";
}else{
btn.innerHTML="开灯";
pic.src="pic_bulboff.gif";
}
}
</script>